package lab01;

import java.util.Scanner;

public class Test08 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入1-100之间的数:");
        int num = (int)(Math.random()*100)+1;
        int count = 0;
        while(true){
            count++;
            int i = sc.nextInt();
            if (i < num){
                System.out.println("猜小了");
            }else if (i > num){
                System.out.println("猜大了");
            }else{
                System.out.println("猜对了");
                System.out.println("你用了"+ count +"次");
            }
        }
    }
}
